feat(eng-12001): add metada commands (CRUD)#288
Open
BartoszBlizniak wants to merge 6 commits intomasterfrom
Open
feat(eng-12001): add metada commands (CRUD)#288BartoszBlizniak wants to merge 6 commits intomasterfrom
BartoszBlizniak wants to merge 6 commits intomasterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new cloudsmith metadata CLI command group to manage v2 package metadata entries (list/get/add/update/remove), including slug resolution via the existing packages API.
Changes:
- Introduces
cloudsmith metadatacommand group with CRUD subcommands, JSON/table output, pagination support, and destructive-action confirmation for removals. - Adds
core.api.packages.get_package_slug_perm()helper to resolve a package’s permanent slug for metadata endpoints. - Adds CLI test coverage for help text, list pagination/filters, JSON output, content loading (inline/file/stdin), validation, update behavior, and remove confirmation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cloudsmith_cli/core/api/packages.py |
Adds get_package_slug_perm() to resolve a package slug_perm for downstream calls. |
cloudsmith_cli/cli/commands/metadata.py |
Implements the new metadata command group and its subcommands (CRUD + formatting/content loading). |
cloudsmith_cli/cli/commands/__init__.py |
Registers the new metadata command module so Click loads the group. |
cloudsmith_cli/cli/tests/commands/test_metadata.py |
Adds a comprehensive test suite for the new command group. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cloudsmith-iduffy
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a new
cloudsmith metadatacommand group for managing metadata entries attached to packages.The command group supports:
cloudsmith metadata list/lsto list metadata for a package, with optional--source-kindand--classificationfilters.cloudsmith metadata list OWNER/REPO/PACKAGE METADATA_SLUG_PERMto retrieve asingle metadata entry.
cloudsmith metadata addto attach metadata from inline JSON, a JSON file, orstdin.
cloudsmith metadata updateto patch metadata content and/or source identity.cloudsmith metadata remove/rmto delete metadata, guarded by the standarddestructive action confirmation flow and
-y/--yes.Example: list metadata for a package
Example response:
Example: add inline metadata
cloudsmith metadata add your-org/awesome-repo/better-pkg \ --content-type application/json \ --source-identity ci:release-42 \ --content '{"release":"2026.05","commit":"abc123"}'Example response:
Example: add build-info or SBOM metadata from a file
Example: invalid JSON returns a usage error before calling the API
cloudsmith metadata add your-org/awesome-repo/better-pkg \ --content-type application/json \ --content '{not json'Example response:
Type of Change
Additional Notes
CLI tests cover help text, list pagination and filters, JSON output, single-entry retrieval, inline/file/stdin content loading, invalid JSON handling, update argument validation, and remove confirmation behavior.
Local checks and testing completed.